/*
 *  dna_framework.h -- provide dna-system application development framework.
 *  
 *  Error code please refer to dna_errno.h
 *
 *  ORIGINAL AUTHOR: Xu Chun (chun.xu@broadlink.com.cn)
 *
 *  Copyright (c) 2016 Broadlink Corporation
 */

#ifndef __DNA_FRAMEWORK_H
#define __DNA_FRAMEWORK_H

#include "dna_device.h"
#include "dna_cloud.h"
#include "dna_profile.h"

#ifdef __cplusplus
    extern "C" {
#endif

/*
*  dna-system framework send notification to application layer.
*/
typedef enum {
    DNA_NOTIFY_PRODUCT_TEST          =  0,
    DNA_NOTIFY_AIRCONFIG_DONE,
} dna_notify_type_e;

/*
*  dna-system framework notification handler descriptor.
*  @type: notification type, refer to dna_notify_type_e.
*/
typedef void (* dna_notify_cb_t)(int type);

/*
*  dna-system get product information (from device profile) interface.
*
*  Return NULL means product not ready.
*/
dna_device_info_t * dna_get_product_info(void);

/*
*   dna-system network status notice interface.
*
*   @netstate: DNA_MODULE_WIFI_CONFIG - DNA_MODULE_CLOUD_LINK
*   (Please refer to dna_devicecmd.h)
*/
void dna_netstate_notice(int netstate);

/*
*  dna-system framework standard UART communication auto-test interface.
*
*  Return 0 means UART communication test success.
*/
int dna_framework_uartcomm_test(void);

/*
*  dna-system framework notification handler register interface (Temporary).
*  If user need it, then register it to framework.
*
*  Return 0 means register success.
*/
int dna_framework_notify_register(dna_notify_cb_t notify_cb);

/*
*  dna-system framework startup interface.
*
*  Return 0 means framework startup success.
*/
int dna_framework_start(void);

#ifdef __cplusplus
}
#endif

#endif

